<template>
<div class="step-main">
    <div class="add"></div>
    <input v-model="valueShow" :placeholder="placeholder" @blur="inputBlur" />
    <div class="reduce"></div>
</div>
</template>
<script setup lang="ts" name="">
import { ref } from "vue"

interface Props{
    value?:string|number;
    placeholder?:string;
}

const props =  withDefaults(defineProps<Props>(),{
    value:"",
    placeholder:'请输入内容'
})


const valueShow = ref<string>(props.value.toString());

const inputBlur = () => {
  // console.log( num.value);
//   valueShow.value =  valueShow.value.replace(/\D!\./g,'') ;
//   if (
//     num.value / props.step ===
//     parseInt((num.value / props.step).toString())
//   ) {

    //在区间中
//     if (props.min !== undefined && num.value < props.min) num.value = props.min;
//     else if (props.max !== undefined && num.value > props.max) num.value = props.max;
//   }else{
//      num.value = props.value;  //不在该区间内
//   }
//   emits("update:value", num.value);
};


</script>
<style scoped lang="scss">
@import "./index.scss";
</style>